package com.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class RequestMappingUtils2 {

    private static Properties properties = new Properties();

    private static Map<String, Object> targetObjectMap = new HashMap<>();

    static {
        InputStream inputStream = DBUtils.class.getResourceAsStream("/requestmapping.properties");
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getMethod(String key) {
        return properties.getProperty(key);
    }


    public static Object getTarget(String uri) {
        return targetObjectMap.get(uri);
    }



    public static Object addTarget(String uri,Object target) {
        return targetObjectMap.put(uri, target);
    }
}
